package cn.edu.neu.springbootdemo.service.impl;

import java.util.List;

import cn.edu.neu.springbootdemo.model.Pingfen;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.edu.neu.springbootdemo.mapper.UserMapper;
import cn.edu.neu.springbootdemo.model.User;
import cn.edu.neu.springbootdemo.service.UserService;


@Service //使用@Service注解，SpringBoot自动扫描
public class UserServiceImpl implements UserService{
	@Autowired
	private UserMapper mapper;

	@Override
	public User existsUser(User user) {
		// TODO Auto-generated method stub
		return mapper.existsUser(user);
	}

	@Override
	public List<User> getUserList() {

		return mapper.getUserList();
	}

	@Override
	public List<User> getfindUser(User user) {
		return mapper.getfindUser( user);
	}

	@Override
	public Boolean deleteUser(int a) {

		return mapper.deleteUser(a);
	}

	@Override
	public void addUser(User user) {

       mapper.addUser(user);
	}

	@Override
	public User findById(User user) {
		return mapper.findById(user);
	}

	@Override
	public void upData(User user) {
		mapper.upData(user);
	}

	@Override
	public Pingfen getRate(int id) {
		return mapper.getRate(id);
	}

	@Override
	public void addRate(int id, int rate) {
		mapper.addRate(id,rate);
	}
}
